 //form表单中  button按钮默认的是submit效果
      //1、button标签的属性 submit修改为button
      //2、阻止默认事件
      $('button').click(function(){
        const xhr = myPromiseJQueryAjax('../server/goods_login.php','post',{userName:$('[name="name"]').val(),userPwd:$('[name="pwd"]').val()},'json');
        xhr.then(function(res){
          console.log(res);
          if (res.result === 1) {
            mySetCookie( 'login' , 1 , 7*24*60*60 , '/' );
            // 跳转页面
            if(window.confirm('您登录成功,点击确定跳转来时候的页面')){
              if (window.location.search.substr(5) === '') {
                window.location.href = './index.html';
              }else{
                window.location.href = `${window.location.search.substr(5)}`;
              } 
            }
            
          }else if (res.result === 0) {
            window.alert('您的账号密码有误，请重新输入')
          }
          

        })
        

      })
